package com.itheima.testjian;

import java.util.Scanner;

public class UserLogin {
    public static void main(String[] args) {

        String userName = "admin";
        String passWord = "123456";

        Scanner sc = new Scanner(System.in);

        for(int i = 1; i <=3 ; i++){
            System.out.println("请输入用户名:");
            String scUserName = sc.nextLine();
            System.out.println("请输入密码:");
            String scPassWord = sc.nextLine();

            if(userName.equals(scUserName) && passWord.equals(scPassWord)){
                System.out.println("登陆成功!");
                break;
            }else{
                if(i==3){
                    System.out.println("您今日的输入上限已达到，请明日再来！");
                }else{
                    System.out.println("登陆失败，您还剩余"+ (3-i) + "次机会!");
                }

            }
        }

    }
}
